package com.taa.infrastructure.dao;

import com.taa.infrastructure.dao.po.Product;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * @author: taa
 * @Desc: 商品Da
 * @create: 2025-06-01 15:46
 **/
@Mapper
public interface IProductDao {

    int insert(Product product);

    int update(Product product);

    Product selectById(Long id);

    List<Product> selectByIds(List<Long> ids);

    int reduceStock(Long productId);

    int updateStock(@Param("productId") Long productId, @Param("stock") Integer stock);

    List<Product> selectAll();
}
